import { dbsrvHttp } from '@/utils/http/axios';
import { IOldMenuModule } from './model/menuModel';
import { getAuthCache } from '@/utils/auth';
import { APP_ID_KEY } from '@/enums/cacheEnum';

enum Api {
  GetMenuList = '/rest/auth/user/perms',
}

/**
 * @description: Get user menu based on id
 */

export const getMenuList = () => {
  return dbsrvHttp.get<IOldMenuModule>({
    url: Api.GetMenuList,
    params: { appId: getAuthCache(APP_ID_KEY) },
  });
};
